using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;

namespace Data_Access_Tier
{
	public class HRM_PROCESS_SALARYData : DatabaseObjectBase
	{
		public HRM_PROCESS_SALARYData()
		{
			Initialize(true);
		}
		public HRM_PROCESS_SALARYData(Boolean newConnection)
		{
			Initialize(newConnection);
		}

		public Int32 HRM_PROCESS_SALARY_Insert(Guid SalaryID, String EmployeeCode, String OldRankSalary, Int32 OldStepSalary, Double OldCoefficientSalary, Decimal OldMinimumSalary, Decimal OldBasicSalary, String NewRankSalary, Int32 NewStepSalary, Double NewCoefficientSalary, Decimal NewMinimumSalary, Decimal NewBasicSalary, DateTime Date, String Reason, String DecideNumber, String Person)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.InsertCommand = new SqlCommand("HRM_PROCESS_SALARY_Insert");
				_dbadapter.InsertCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.InsertCommand.Connection = _dbconn;
				_trans = _dbconn.BeginTransaction();
				_dbadapter.InsertCommand.Transaction = _trans;
				_dbadapter.InsertCommand.Parameters.Clear();
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@SalaryID", SqlDbType.UniqueIdentifier));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@OldRankSalary", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@OldStepSalary", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@OldCoefficientSalary", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@OldMinimumSalary", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@OldBasicSalary", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@NewRankSalary", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@NewStepSalary", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@NewCoefficientSalary", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@NewMinimumSalary", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@NewBasicSalary", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Reason", SqlDbType.NVarChar, 1000));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@DecideNumber", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Person", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Prepare();
				SqlGuid SalaryIDSQL = SalaryID;
				_dbadapter.InsertCommand.Parameters["@SalaryID"].Value = SalaryIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.InsertCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				SqlString OldRankSalarySQL = OldRankSalary;
				_dbadapter.InsertCommand.Parameters["@OldRankSalary"].Value = OldRankSalarySQL;
				SqlInt32 OldStepSalarySQL = OldStepSalary;
				_dbadapter.InsertCommand.Parameters["@OldStepSalary"].Value = OldStepSalarySQL;
				SqlDouble OldCoefficientSalarySQL = OldCoefficientSalary;
				_dbadapter.InsertCommand.Parameters["@OldCoefficientSalary"].Value = OldCoefficientSalarySQL;
				SqlMoney OldMinimumSalarySQL = OldMinimumSalary;
				_dbadapter.InsertCommand.Parameters["@OldMinimumSalary"].Value = OldMinimumSalarySQL;
				SqlMoney OldBasicSalarySQL = OldBasicSalary;
				_dbadapter.InsertCommand.Parameters["@OldBasicSalary"].Value = OldBasicSalarySQL;
				SqlString NewRankSalarySQL = NewRankSalary;
				_dbadapter.InsertCommand.Parameters["@NewRankSalary"].Value = NewRankSalarySQL;
				SqlInt32 NewStepSalarySQL = NewStepSalary;
				_dbadapter.InsertCommand.Parameters["@NewStepSalary"].Value = NewStepSalarySQL;
				SqlDouble NewCoefficientSalarySQL = NewCoefficientSalary;
				_dbadapter.InsertCommand.Parameters["@NewCoefficientSalary"].Value = NewCoefficientSalarySQL;
				SqlMoney NewMinimumSalarySQL = NewMinimumSalary;
				_dbadapter.InsertCommand.Parameters["@NewMinimumSalary"].Value = NewMinimumSalarySQL;
				SqlMoney NewBasicSalarySQL = NewBasicSalary;
				_dbadapter.InsertCommand.Parameters["@NewBasicSalary"].Value = NewBasicSalarySQL;
				SqlDateTime DateSQL = SqlDateTime.Null;
				if (Date > DateTime.MinValue)
				{
					try
					{
						DateSQL = Date;
					}
					catch (Exception eDate)
					{
						String DateMessage = eDate.Message;
						DateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@Date"].Value = DateSQL;
				SqlString ReasonSQL = Reason;
				_dbadapter.InsertCommand.Parameters["@Reason"].Value = ReasonSQL;
				SqlString DecideNumberSQL = DecideNumber;
				_dbadapter.InsertCommand.Parameters["@DecideNumber"].Value = DecideNumberSQL;
				SqlString PersonSQL = Person;
				_dbadapter.InsertCommand.Parameters["@Person"].Value = PersonSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.InsertCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_PROCESS_SALARY_Insert: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_PROCESS_SALARY_Insert: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.InsertCommand != null)
					_dbadapter.InsertCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_PROCESS_SALARY_Update(Guid SalaryID, String EmployeeCode, String OldRankSalary, Int32 OldStepSalary, Double OldCoefficientSalary, Decimal OldMinimumSalary, Decimal OldBasicSalary, String NewRankSalary, Int32 NewStepSalary, Double NewCoefficientSalary, Decimal NewMinimumSalary, Decimal NewBasicSalary, DateTime Date, String Reason, String DecideNumber, String Person)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_PROCESS_SALARY_Update");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SalaryID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldRankSalary", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldStepSalary", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldCoefficientSalary", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldMinimumSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldBasicSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewRankSalary", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewStepSalary", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewCoefficientSalary", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewMinimumSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewBasicSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Reason", SqlDbType.NVarChar, 1000));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecideNumber", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Person", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid SalaryIDSQL = SalaryID;
				_dbadapter.UpdateCommand.Parameters["@SalaryID"].Value = SalaryIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.UpdateCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				SqlString OldRankSalarySQL = OldRankSalary;
				_dbadapter.UpdateCommand.Parameters["@OldRankSalary"].Value = OldRankSalarySQL;
				SqlInt32 OldStepSalarySQL = OldStepSalary;
				_dbadapter.UpdateCommand.Parameters["@OldStepSalary"].Value = OldStepSalarySQL;
				SqlDouble OldCoefficientSalarySQL = OldCoefficientSalary;
				_dbadapter.UpdateCommand.Parameters["@OldCoefficientSalary"].Value = OldCoefficientSalarySQL;
				SqlMoney OldMinimumSalarySQL = OldMinimumSalary;
				_dbadapter.UpdateCommand.Parameters["@OldMinimumSalary"].Value = OldMinimumSalarySQL;
				SqlMoney OldBasicSalarySQL = OldBasicSalary;
				_dbadapter.UpdateCommand.Parameters["@OldBasicSalary"].Value = OldBasicSalarySQL;
				SqlString NewRankSalarySQL = NewRankSalary;
				_dbadapter.UpdateCommand.Parameters["@NewRankSalary"].Value = NewRankSalarySQL;
				SqlInt32 NewStepSalarySQL = NewStepSalary;
				_dbadapter.UpdateCommand.Parameters["@NewStepSalary"].Value = NewStepSalarySQL;
				SqlDouble NewCoefficientSalarySQL = NewCoefficientSalary;
				_dbadapter.UpdateCommand.Parameters["@NewCoefficientSalary"].Value = NewCoefficientSalarySQL;
				SqlMoney NewMinimumSalarySQL = NewMinimumSalary;
				_dbadapter.UpdateCommand.Parameters["@NewMinimumSalary"].Value = NewMinimumSalarySQL;
				SqlMoney NewBasicSalarySQL = NewBasicSalary;
				_dbadapter.UpdateCommand.Parameters["@NewBasicSalary"].Value = NewBasicSalarySQL;
				SqlDateTime DateSQL = SqlDateTime.Null;
				if (Date > DateTime.MinValue)
				{
					try
					{
						DateSQL = Date;
					}
					catch (Exception eDate)
					{
						String DateMessage = eDate.Message;
						DateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@Date"].Value = DateSQL;
				SqlString ReasonSQL = Reason;
				_dbadapter.UpdateCommand.Parameters["@Reason"].Value = ReasonSQL;
				SqlString DecideNumberSQL = DecideNumber;
				_dbadapter.UpdateCommand.Parameters["@DecideNumber"].Value = DecideNumberSQL;
				SqlString PersonSQL = Person;
				_dbadapter.UpdateCommand.Parameters["@Person"].Value = PersonSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_PROCESS_SALARY_Update: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_PROCESS_SALARY_Update: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_PROCESS_SALARY_Disable(Guid SalaryID, ref Boolean Enabled)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_PROCESS_SALARY_Disable");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SalaryID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@enabled", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid SalaryIDSQL = SalaryID;
				_dbadapter.UpdateCommand.Parameters["@SalaryID"].Value = SalaryIDSQL;
				_dbadapter.UpdateCommand.Parameters["@enabled"].Direction = ParameterDirection.Output;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_PROCESS_SALARY_Disable: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_PROCESS_SALARY_Disable: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_PROCESS_SALARY_Delete(Guid SalaryID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.DeleteCommand = new SqlCommand("HRM_PROCESS_SALARY_Delete");
				_dbadapter.DeleteCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.DeleteCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.DeleteCommand.Transaction = _trans;

				_dbadapter.DeleteCommand.Parameters.Clear();
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@SalaryID", SqlDbType.UniqueIdentifier));
				_dbadapter.DeleteCommand.Prepare();
				SqlGuid SalaryIDSQL = SalaryID;
				_dbadapter.DeleteCommand.Parameters["@SalaryID"].Value = SalaryIDSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.DeleteCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_PROCESS_SALARY_Delete: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_PROCESS_SALARY_Delete: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.DeleteCommand != null)
					_dbadapter.DeleteCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_PROCESS_SALARY_Save(Guid SalaryID, String EmployeeCode, String OldRankSalary, Int32 OldStepSalary, Double OldCoefficientSalary, Decimal OldMinimumSalary, Decimal OldBasicSalary, String NewRankSalary, Int32 NewStepSalary, Double NewCoefficientSalary, Decimal NewMinimumSalary, Decimal NewBasicSalary, DateTime Date, String Reason, String DecideNumber, String Person)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_PROCESS_SALARY_Save");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SalaryID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EmployeeCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldRankSalary", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldStepSalary", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldCoefficientSalary", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldMinimumSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@OldBasicSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewRankSalary", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewStepSalary", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewCoefficientSalary", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewMinimumSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@NewBasicSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Reason", SqlDbType.NVarChar, 1000));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecideNumber", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Person", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid SalaryIDSQL = SalaryID;
				_dbadapter.UpdateCommand.Parameters["@SalaryID"].Value = SalaryIDSQL;
				SqlString EmployeeCodeSQL = EmployeeCode;
				_dbadapter.UpdateCommand.Parameters["@EmployeeCode"].Value = EmployeeCodeSQL;
				SqlString OldRankSalarySQL = OldRankSalary;
				_dbadapter.UpdateCommand.Parameters["@OldRankSalary"].Value = OldRankSalarySQL;
				SqlInt32 OldStepSalarySQL = OldStepSalary;
				_dbadapter.UpdateCommand.Parameters["@OldStepSalary"].Value = OldStepSalarySQL;
				SqlDouble OldCoefficientSalarySQL = OldCoefficientSalary;
				_dbadapter.UpdateCommand.Parameters["@OldCoefficientSalary"].Value = OldCoefficientSalarySQL;
				SqlMoney OldMinimumSalarySQL = OldMinimumSalary;
				_dbadapter.UpdateCommand.Parameters["@OldMinimumSalary"].Value = OldMinimumSalarySQL;
				SqlMoney OldBasicSalarySQL = OldBasicSalary;
				_dbadapter.UpdateCommand.Parameters["@OldBasicSalary"].Value = OldBasicSalarySQL;
				SqlString NewRankSalarySQL = NewRankSalary;
				_dbadapter.UpdateCommand.Parameters["@NewRankSalary"].Value = NewRankSalarySQL;
				SqlInt32 NewStepSalarySQL = NewStepSalary;
				_dbadapter.UpdateCommand.Parameters["@NewStepSalary"].Value = NewStepSalarySQL;
				SqlDouble NewCoefficientSalarySQL = NewCoefficientSalary;
				_dbadapter.UpdateCommand.Parameters["@NewCoefficientSalary"].Value = NewCoefficientSalarySQL;
				SqlMoney NewMinimumSalarySQL = NewMinimumSalary;
				_dbadapter.UpdateCommand.Parameters["@NewMinimumSalary"].Value = NewMinimumSalarySQL;
				SqlMoney NewBasicSalarySQL = NewBasicSalary;
				_dbadapter.UpdateCommand.Parameters["@NewBasicSalary"].Value = NewBasicSalarySQL;
				SqlDateTime DateSQL = SqlDateTime.Null;
				if (Date > DateTime.MinValue)
				{
					try
					{
						DateSQL = Date;
					}
					catch (Exception eDate)
					{
						String DateMessage = eDate.Message;
						DateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@Date"].Value = DateSQL;
				SqlString ReasonSQL = Reason;
				_dbadapter.UpdateCommand.Parameters["@Reason"].Value = ReasonSQL;
				SqlString DecideNumberSQL = DecideNumber;
				_dbadapter.UpdateCommand.Parameters["@DecideNumber"].Value = DecideNumberSQL;
				SqlString PersonSQL = Person;
				_dbadapter.UpdateCommand.Parameters["@Person"].Value = PersonSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_PROCESS_SALARY_Save: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_PROCESS_SALARY_Save: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_PROCESS_SALARY_GetList()
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_PROCESS_SALARY_GetList");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Prepare();
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_PROCESS_SALARY_GetList: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_PROCESS_SALARY_Get(Guid SalaryID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_PROCESS_SALARY_Get");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@SalaryID", SqlDbType.UniqueIdentifier));
				_dbadapter.SelectCommand.Prepare();
				SqlGuid SalaryIDSQL = SalaryID;
				_dbadapter.SelectCommand.Parameters["@SalaryID"].Value = SalaryIDSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_PROCESS_SALARY_Get: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
	}
}
